package org.jash.shop2202

import android.app.Application
import com.alibaba.android.arouter.launcher.ARouter
import com.alipay.sdk.app.EnvUtils
import com.hyphenate.chat.ChatClient
import com.hyphenate.helpdesk.easeui.UIProvider
import dagger.hilt.android.HiltAndroidApp
import org.jash.shop2202.utils.StoreUtils


// 支付宝公钥:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs8frgoO15MnD1KDwKnzAylpqRoyLh78eOU79iVt1wxzPIKO2xkKA0p+MjCww81NuMqWxGJwRFeKJpArVxqSjgJWruuwftNrCz0Nqc4MixJz2qskRwxm+AGgIaYUjUegGTbfkQHCAc0FbvsbaVWQzERu2QkN6DHq/ObyDY0OYeY3Pfzok3TydlvU2Ad2TEq/H+GIPpvPARbcT3FXiXaNXCWzoJ8DkYi419ND/rK5tmENher2rC0CavBrStvCpDP1H/2G7gsj5u7s2tdQ/8SwcQO5M9rVrilIktA+YxCJ75Te+5lclr0e5eJcv36luwaWXs6i0L+QyE/YlvkRz3Iq/dQIDAQAB
@HiltAndroidApp
class App:Application() {
    override fun onCreate() {
        super.onCreate()
        if (BuildConfig.DEBUG) {
            ARouter.openLog()
            ARouter.openDebug()
        }
        ARouter.init(this)
        StoreUtils.init(this, "MMKV")
        EnvUtils.setEnv(EnvUtils.EnvEnum.SANDBOX)
        val options = ChatClient.Options()
        options.setAppkey("1458240411068158#kefuchannelapp108947") //必填项，appkey获取地址：kefu.easemob.com，“管理员模式 > 渠道管理 > 手机APP”页面的关联的“AppKey”
        options.setTenantId("108947") //必填项，tenantId获取地址：kefu.easemob.com，“管理员模式 > 账户 > 账户信息 > 租户ID一栏的数据”


        // Kefu SDK 初始化
        if (!ChatClient.getInstance().init(this, options)) {
            return
        }

        // Kefu EaseUI的初始化
        UIProvider.getInstance().init(this)
    }
}